package com.simplemall.micro.serv.tel.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.simplemall.micro.serv.common.bean.telbook.TelBook;
import com.simplemall.micro.serv.tel.service.TelBookService;
import com.simplemall.micro.serv.tel.mapper.TelBookMapper;

@Service
public class TelBookServiceImpl implements TelBookService{

	@Autowired
	TelBookMapper telBookMapper;
	
	@Override
	public List<TelBook> getTelBookByUserid(String userid) {
		List<TelBook> telList = telBookMapper.selectByUserid(userid);
		return telList;
	}

	@Override
	public int createTelBook(TelBook telBook) {
		return telBookMapper.insertSelective(telBook);
	}

	@Override
	public void deleteTelBook(String id) {
		telBookMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int getTelBookCountByUserid(String userid) {
		return telBookMapper.getTelBookCountByUserid(userid);
	}

}
